<template>
    <a
      v-bind:class="[disable?'returnBack-a-disable':'','returnBack-a']"
      v-on:click="buttonEvent"
    >{{title}}</a>
</template>
<style scoped>
.returnBack-a {
  background-color: #18ceb4;
  color: #ffffff;
  width:90px;
  height:42px;
  line-height: 42px;
  border: 1px solid #18ceb4;
  text-align: center;
  cursor: pointer;
  margin: 5px;
  border-radius: 4px;
  font-size:16px;
}
.returnBack-a-disable {
  cursor: not-allowed;
  background-color: #e6e6e6;
  border: 1px solid #e6e6e6;
}
</style>
<script>
//表格内操作按钮
export default {
  name: "returnBack",
  props: {
    disable: {
      default: false
    },
    title: {
      default: ""
    }
  },
  meta: {
    descr: "返回登录"
  },
  methods: {
    buttonEvent: function() {
        let that=this;
        that.$router.push({
            path: '/',
        }); 
        if (!that.disable) {
            that.$emit("click");
        }
    }
  }
};
</script>